<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>栏目管理 -- 修改子栏目</title>
<link type="text/css" rel="stylesheet" href="main.css"/>
<script src="jquery.js" language="javascript" type="text/javascript"></script>
<script src="base.js" language="javascript" type="text/javascript"></script>
<script language="javascript"> 
var channelArray = new Array();
<?php    
$i = 0;
foreach($channelArray as $k=>$arr){
  echo "channelArray[$k] = \"{$arr['nid']}\";\r\n";
}
?>
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
function ParTemplet(obj)
{
  var sevvalue = channelArray[obj.value];
  var tempindex = document.getElementsByName('tempindex');
  var templist = document.getElementsByName('templist');
  var temparticle = document.getElementsByName('temparticle');
  var dfstyle = document.getElementsByName('dfstyle');
  var dfstyleValue = dfstyle[0].value;
  tempindex[0].value = dfstyleValue+"/{lang}/index_"+sevvalue+".htm";
  templist[0].value = dfstyleValue+"/{lang}/list_"+sevvalue+".htm";
  temparticle[0].value = dfstyleValue+"/{lang}/article_"+sevvalue+".htm";
  if(obj.value < 0)
  {
  	if(Nav()=='IE') tobj.style.display = "block";
	  else tobj.style.display = "table-row";
  }
  else
  {
  	tobj.style.display = "none";
  }
}
</script> 

<style>
.exshow {
	background:url(img/tbody_toggle.gif) 0 -15px no-repeat;
	width:50px;
	height:15px;
	font-size:0px;
	color:#fafafa;
	cursor:pointer;
}
.exhide {
	background:url(img/tbody_toggle.gif) no-repeat;
	width:50px;
	height:15px;
	font-size:0px;
	color:#fafafa;
	cursor:pointer;
}
.ctbody {
}
a.exbody {
	color:#fafafa;
}
.fl {
	float:left;
}
</style>
<script language="javascript" src="../images/js/j.js"></script>
<script language="javascript">
	
$(function(){
	ExbodyClick();
});
function ExbodyClick()
{
	$("a.exbody").click(function(){
  	if( $("tr.ctbody").get(0).style.display=="none") {
  		$(".ctbody").show();
  		$(".exbody div").get(0).className="exhide";
  	}
  	else {
  		$(".ctbody").hide();
  		$(".exbody div").get(0).className="exshow";
  	}
	});
}
function ShowHideHelp(spanid)
{
	if( $("#"+spanid).get(0).style.display=="none") {
		$("#"+spanid).show();
	} else {
		$("#"+spanid).hide();
	}
}

function SelectTemplets(fname) {
   if(document.all){
     var posLeft = window.event.clientY-100;
     var posTop = window.event.clientX-400;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
   window.open("../include/dialog/select_templets.php?f="+fname, "poptempWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
}

function ShowHide(objname) {
  if(obj.style.display != "none") $("#"+objname).hide();
  else $("#"+objname).show();
}

function ShowObj(objname) {
   $("#"+objname).show();
}

function HideObj(objname) {
  $("#"+objname).hide();
}

function CheckTypeDir() {
  var upinyin = document.getElementById('upinyin');
  var tpobj = document.getElementById('typedir');
  if(upinyin.checked) tpobj.style.display = "none";
  else tpobj.style.display = "block";
}

function checkSubmit()
{
   if(document.form1.typename.value=="")
   {
		  alert("栏目名称不能为空！");
		  document.form1.typename.focus();
		  return false;
	 }
	 return true;
}

</script>

<style>
.tabbox{
width:260px;
height:30px;
}
.tabbox li{text-align:center;display:block;cursor:pointer;width:80px;height:30px;line-height:30px;background:url(img/itemnote1.gif) repeat-x;	font-size:12px;color:#006600;font-weight:bold;float:left;}
.tabbox .hover{width:80px;background:url(img/itemnote2.gif) repeat-x;height:29px;line-height:29px;}
</style>
</head>
<body>
<div class="mtitle">
  <div class="lbox">栏目管理</div>
</div>
<table class="tform">
  <tbody>
    <tr>
      <td align="left"><IMG height=14 src="img/book1.gif" width=20> &nbsp;<a href="catalog_main.php"><strong>栏目管理</strong></a> &gt;&gt; <strong>修改子栏目</strong></td>
      <td align="right"></td>
    </tr>
  </tbody>
</table>
<div class="tabbox">
<ul>
<li id="two1" class="hover"  onclick="setTab('two',1,3)"> 修改栏目</li>
<li id="two2"  onclick="setTab('two',2,3)"> 模板管理</li>
<li id="two3"  onclick="setTab('two',3,3)"> 高级选项</li>
</ul>
</div>
<form name="form1" action="catalog_edit.php" method="post" onSubmit="return checkSubmit();">
  <input type="hidden" name="dopost" value="save" />
  <input type="hidden" name="id" id="id" value="<?php echo $myrow['id']; ?>" />
  <input type="hidden" name="topid" id="topid" value="<?php echo $topid; ?>" />
  <table class="tform" id="con_two_1" > 
    <tbody>
      <tr>
        <th colspan="2"><strong>必选项目</strong></th>
      </tr>
      <tr>
        <td class='bline' width="20%" height="26"><strong><font color='red'>&nbsp;内容模型：</font></strong></td>
        <td class='bline' width="80%"><select name="channeltype" id="channeltype" style="width:200px"  onChange="ParTemplet(this)">
            <?php
            foreach($channelArray as $k=>$arr)
            {
            	if($k==$channelid)
            	{
            		$nid = $arr['nid'];
            		echo "    <option value='{$k}' selected>{$arr['typename']}|{$arr['nid']}</option>\r\n";
              }
              else
              {
              	  echo "    <option value='{$k}'>{$arr['typename']}|{$arr['nid']}</option>\r\n";
          		}
            }
            ?>
          </select> <input type='hidden' value='{style}' name='dfstyle' /></td>
      </tr>
      <tr>
        <td class='bline' height="26"><strong><font color='red'>&nbsp;栏目名称：</font></strong></td>
        <td class='bline'><input name="typename" type="text" id="typename" size="30" class="txt" value="<?php echo $myrow['typename']; ?>" /></td>
      </tr>
      <tr>
        <td height="26" class='bline'><strong> &nbsp;排列顺序： </strong></td>
        <td class='bline'><input name="sortrank" size="6" type="text" class="txt" value="<?php echo $myrow['sortrank']; ?>" style="width:60px" />
          （由低 -&gt; 高） </td>
      </tr>
      <tr>
        <td height="26" class='bline'><strong>&nbsp;文件保存目录：</strong></td>
        <td class='bline'><input name="typedir" type="text" id="typedir" value="<?php echo $myrow['typedir']; ?>" class="txt" style="width:350px" /></td>
      </tr>
      <tr>
        <td height="26" class='bline'>&nbsp;<strong>文 件 名：</strong></td>
        <td class='bline'><input name="defaultname" type="text" class="txt" id="defaultname" value="<?php echo $myrow['defaultname']; ?>" size="30" />
          <strong>(非单独内容页不要修改此项)</strong></td>
      </tr>
      <tr>
        <td height="26" class='bline'><strong>&nbsp;栏目属性：</strong></td>
        <td class='bline'><input name="ispart" type="radio" id="radio" value="0" class='np' <?php if($myrow['ispart']==0) echo " checked"; ?> />
          最终列表栏目（允许在本栏目发布文档，并生成文档列表） <br>
          <input name="ispart" type="radio" id="radio" value="1" class='np' <?php if($myrow['ispart']==1) echo " checked"; ?> />
          频道封面（栏目本身不允许发布文档） <br>
          <input name="ispart" type="radio" id="radio" value="3" class='np' <?php if($myrow['ispart']==3) echo " checked"; ?> />
          仅为单独内容页（关于我们、公司简介之类） <br>
          <input name="ispart" type="radio" id="radio" value="2" class='np' <?php if($myrow['ispart']==2) echo " checked"; ?> />
          外部连接（在"文件保存目录"处填写网址） </td>
      </tr>
	   <tr class='ctbody'>
        <td class='bline'><strong>&nbsp;页面内容：</strong></td>
        <td class='bline'> (栏目页面内容是栏目模板中直接调用的HTML信息，调用标签为{dede:field name='content' /}) </td>
      </tr>
      <tr class='ctbody'>
        <td colspan="2"><?php
	            GetEditor("content",$myrow['content'],"450","Default","print","false");
	        ?></td>
      </tr>
    </tbody>
	</table>
	  <table  class="tform" id="con_two_2" style="display:none">
       <tbody>
	   
      <tr>
        <th colspan="2" ><strong>模板管理</strong></th>
      </tr>
	    <tr>
            <td height="26" class='bline'>&nbsp;<strong>频道封面模板：</strong></td>
            <td class='bline'><input name="tempindex" type="text" class="txt" id="tempindex" style="width:250px" value="<?php echo $myrow['tempindex']; ?>" size="30" class="pubinputs"/><button type="button" name="set3" class="btn1s" style="width:60px" onClick="SelectTemplets('form1.tempindex');" />浏览...</button>
            
            </td>
        </tr>
	   <tr>
            <td height="26" class='bline'>&nbsp;<strong>列表模板：</strong></td>
            <td class='bline'><input name="templist" type="text" class="txt" id="templist" style="width:250px" value="<?php echo $myrow['templist']; ?>" size="30" class="pubinputs"/><button type="button" name="set3" class="btn1s" style="width:60px" onClick="SelectTemplets('form1.templist');" />浏览...</button>
            
            </td>
        </tr>
				   <tr>
            <td height="26" class='bline'>&nbsp;<strong>文章模板：</strong></td>
            <td class='bline'><input name="temparticle" type="text" class="txt" id="temparticle" style="width:250px" value="<?php echo $myrow['temparticle']; ?>" size="30" class="pubinputs" />  <button type="button" name="set4"  class="btn1s" style="width:60px" onClick="SelectTemplets('form1.temparticle');"/>浏览...</button>
             
            </td>
        </tr>
		<tr>
            <td height="26" class='bline'>&nbsp;<strong>单页模板：</strong></td>
            <td class='bline'><input name="tempsgpage" type="text" class="txt" id="tempsgpage" style="width:250px" value="<?php echo $myrow['tempsgpage']; ?>" size="30" class="pubinputs" /><button type="button" name="set4"  class="btn1s" style="width:60px" onClick="SelectTemplets('form1.tempsgpage');"/> 浏览...</button>
             
            </td>
        </tr>
          <tr>
            <td height="26" class='bline'>&nbsp;<strong>文章命名规则：</strong></td>
            <td class='bline'><input name="namerule" type="text" class="txt" id="namerule" style="width:250px" value="<?php echo $myrow['namerule']; ?>" size="30" class="pubinputs" />
            
            </td>
        </tr>

		  <tr>
            <td height="26" class='bline'>&nbsp;<strong>分页命名规则：</strong></td>
            <td class='bline'><input name="namerule2" type="text" class="txt" id="namerule2" style="width:250px" value="<?php echo $myrow['namerule2']; ?>" size="30" class="pubinputs" />
            
            </td>
        </tr>
		 
       
	  

	</table>
	<table class="tform" id="con_two_3" style="display:none">
    <tbody>
      <tr>
        <th colspan="2"><strong>高级内容</strong></th>
      </tr>
	    <tr>
            <td height="26" class='bline'>&nbsp;<strong>是否隐藏：</strong></td>
            <td class='bline'><input type='radio' name='ishidden' value='0' class='np'<?php if($myrow['ishidden']=="0") echo " checked='1' ";?>/>
              显示　&nbsp; <input type='radio' name='ishidden' value='1' class='np'<?php if($myrow['ishidden']=="1") echo " checked='1' ";?>/>
              隐藏 
             
            </td>
        </tr>
		
		<tr>
            <td height="26" class='bline'>&nbsp;<strong>栏目类型：</strong></td>
            <td class='bline'><input type='radio' name='isdefault' value='1' class='np' <?php if($myrow['isdefault']=="1") echo " checked='1' ";?> />
            静态　
            &nbsp;
              <input type='radio' name='isdefault' value='-1' class='np' <?php if($myrow['isdefault']=="-1") echo " checked='1' ";?>/>
              动态
             
            </td>
        </tr>

<!--  <tr>
            <td height="26" class='bline'>&nbsp;<strong>目标打开方式：</strong></td>
            <td class='bline'><input type='radio' name='target' value='' class='np' <?php if($myrow['target']=="") echo " checked='checked' ";?> />
              本窗口　&nbsp;
              <input type='radio' name='target' value='target=_blank' class='np' <?php if($myrow['target']=="target=_blank") echo " checked='checked' ";?>/>
              新窗口
             
            </td>
        </tr> -->
      <tr class='ctbody'>
        <td height="65"  class='bline'><strong>&nbsp;关 键 字：</strong></td>
        <td  class='bline'><input type="input" name="keywords" id="keywords" class="txt" style="width:420px" value="<?php echo $myrow['keywords']; ?>" /></td>
      </tr>
      <tr class='ctbody'>
        <td height="65"  class='bline'><strong>&nbsp;页面摘要：</strong></td>
        <td height="65"  class='bline'><textarea name="description" cols="70" rows="4" id="description" class="txt" style="width:420px;height:60px"><?php echo $myrow['description']; ?></textarea></td>
      </tr>
     
    </tbody>
  </table>
  <table width="98%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1%" height="50"></td>
      <td width="99%" valign="bottom"><button type="submit" class="btn1">确定</button>
        &nbsp;&nbsp;&nbsp;
        <button type="button" class="btn1" onClick="location='catalog_main.php';">返回</button></td>
    </tr>
  </table>
</form>
</body>
</html>
